import request from '@/utils/request'

export function getList(limit, page, search_word, material_type) {
  return request({
    url: '/api/material/material_csa',
    method: 'get',
    params: {
      limit,
      page,
      search_word,
      material_type
    }
  })
}
export function getUnits() {
  return request({
    url: '/api/material/basic_measure_unit_list',
    method: 'get'
  })
}
export function add(data) {
  return request({
    url: '/api/material/material_csa_add',
    method: 'post',
    data: {
      material_code: data.code,
      material_name: data.name,
      csa_code: data.csacode,
      csa_name: data.csaname
    }
  })
}
export function deleteMaterial(ids) {
  return request({
    url: '/api/material/material_csa_del',
    method: 'post',
    data: {
      ids
    }
  })
}
export function edit(data) {
  return request({
    url: '/api/material/material_csa_edit',
    method: 'post',
    data: {
      id: data.id,
      material_code: data.material_code,
      material_name: data.material_name,
      csa_code: data.csa_code,
      csa_name: data.csa_name
    }
  })
}
